#include "stdafx.h"

#include "media\animations\Anim.h"
#include "media\MediaManager.hpp"


TEST(AnimTest, load)
{
	Anim goRight;
	sf::Image image;
	image = MediaManager<sf::Image>::getInstance().getMedia("../JIN4/media/player_test.png");

	Frame frame1 = Frame(image, sf::Rect<int>(image.getSize().y / 5, 0, image.getSize().y / 5, image.getSize().y / 3));
	Frame frame2 = Frame(image, sf::Rect<int>(image.getSize().y / 5 * 3, 0, image.getSize().y / 5, image.getSize().y / 3));

	goRight.pushFrame(frame1);
	goRight.pushFrame(frame2);
	goRight.setName("goRight");


	EXPECT_EQ(goRight.size(), 2);

	EXPECT_EQ(goRight.getName(), "goRight");

	Anim goRight2(goRight);
	EXPECT_TRUE(goRight == goRight2);

	goRight.reset();
	EXPECT_EQ(goRight.size(), 0);
}